package com.tgd.RingtoneContactManager;

/**
 * This interface will be used by the client to access information about a
 * group.
 */
public interface Group {

    /**
     * This enumeration is used to determine how the groups should be filtered.
     */
    static enum Filter {
        /**
         * Given to {link
         * {@link DAO#getGroups(DAO.Group.Filter, DAO.Group.Sort)} so the return
         * list contains all groups.
         */
        ALL,
        /**
         * Given to {@link DAO#getGroups(DAO.Group.Filter, DAO.Group.Sort)} so
         * the return list contains only groups that contain contacts with
         * custom ringtones. This means that only groups in which all contacts
         * are set to use the default ringtone will be excluded.
         */
        CUSTOM,
    }

    /**
     * This enumeration is used to determine how the groups should be sorted.
     */
    static enum Sort {
        /**
         * Given to {@link DAO#getGroups(DAO.Group.Filter, DAO.Group.Sort)} so
         * the returned list is sorted by the name of the group. Sort order for
         * 2 identical names is undefined.
         */
        NAME,
        /**
         * Given to {@link DAO#getGroups(DAO.Group.Filter, DAO.Group.Sort)} so
         * the returned list is sorted by the name of the ringtone which each
         * group uses. If two groups use the same ringtone they are sorted by
         * the name of the group.
         */
        // TODO groups are harder to sort, how to sort groups with varying
        // ringtones? Number of contacts?
        TODO_UNKNOWN_OTHER,
    }

    /**
     * @return The contacts that are in this group.
     */
    public Contact[] getContacts();

    /**
     * @return The id of the group.
     */
    public String getId();

    /**
     * @return The name of the group.
     */
    public String getName();

    /**
     * @return The ringtones that the contacts in this group use.
     */
    public Ringtone[] getRingtones();

    /**
     * @return The account this group belongs to.
     */
    public String getAccount();
}
